/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bombercloud.commons;

import java.io.Serializable;

/**
 *
 * @author Leonardo Oliveira Moreira
 */
public class GameAction implements Serializable {

    public static final int UP = 0;
    public static final int DOWN = 1;
    public static final int LEFT = 2;
    public static final int RIGHT = 3;

    public int action = -1;
    public boolean processed = false;

    public int avatarWidth = -1;
    public int avatarHeight = -1;

    public int dimensionWidth = -1;
    public int dimensionHeight = -1;

    private int playerId = -1;

    public GameAction(int dimensionWidth, int dimensionHeight, int avatarWidth, int avatarHeight) {
        this.dimensionWidth = dimensionWidth;
        this.dimensionHeight = dimensionHeight;
        this.avatarWidth = avatarWidth;
        this.avatarHeight = avatarHeight;
    }

    public int getAction() {
        return action;
    }

    public void setAction(int action) {
        this.action = action;
    }

    public boolean isProcessed() {
        return processed;
    }

    public void setProcessed(boolean processed) {
        this.processed = processed;
    }

    public int getPlayerId() {
        return playerId;
    }

    public void setPlayerId(int playerId) {
        this.playerId = playerId;
    }

    public int getAvatarWidth() {
        return avatarWidth;
    }

    public void setAvatarWidth(int avatarWidth) {
        this.avatarWidth = avatarWidth;
    }

    public int getAvatarHeight() {
        return avatarHeight;
    }

    public void setAvatarHeight(int avatarHeight) {
        this.avatarHeight = avatarHeight;
    }

    public int getDimensionWidth() {
        return dimensionWidth;
    }

    public void setDimensionWidth(int dimensionWidth) {
        this.dimensionWidth = dimensionWidth;
    }

    public int getDimensionHeight() {
        return dimensionHeight;
    }

    public void setDimensionHeight(int dimensionHeight) {
        this.dimensionHeight = dimensionHeight;
    }

    public String getActionString() {
        switch (getAction()) {
            case GameAction.UP: {
                return "UP";
            }
            case GameAction.DOWN: {
                return "DOWN";
            }
            case GameAction.LEFT: {
                return "LEFT";
            }
            case GameAction.RIGHT: {
                return "RIGHT";
            }
        }
        return "UNKNOWN";
    }

}
